.class public Lcom/bitauto/autoeasy/selectcar/Object/DealerDetailParser;
.super Ljava/lang/Object;
.source "DealerDetailParser.java"


# static fields
.field private static final CALLCENTERNUMBER:Ljava/lang/String; = "vci_SaleTel"

.field private static final GOOGLEMAPLAT:Ljava/lang/String; = "GoogleMapLat"

.field private static final GOOGLEMAPLNG:Ljava/lang/String; = "GoogleMapLng"

.field private static final VENDORBIZMODE:Ljava/lang/String; = "bizmode"

.field private static final VENDORFULLNAME:Ljava/lang/String; = "vbi_fullname"

.field private static final VENDORID:Ljava/lang/String; = "vendorID"

.field private static final VENDORNAME:Ljava/lang/String; = "vbi_name"

.field private static final VENDORSALEADDR:Ljava/lang/String; = "vci_SaleAddr"

.field private static final VENDORSHOPPIC:Ljava/lang/String; = "VendorShopPic"

.field private static final VENDORSITE:Ljava/lang/String; = "AutoSiteDomain"


# instance fields
.field private TAG:Ljava/lang/String;

.field private dealer:Lcom/bitauto/autoeasy/selectcar/Object/Dealer;

.field private url:Ljava/lang/String;


# direct methods
.method public constructor <init>(Ljava/lang/String;)V
    .locals 1
    .parameter "url"

    .prologue
    .line 55
    invoke-direct {p0}, Ljava/lang/Object;-><init>()V

    .line 52
    const-string v0, ""

    iput-object v0, p0, Lcom/bitauto/autoeasy/selectcar/Object/DealerDetailParser;->url:Ljava/lang/String;

    .line 53
    const-string v0, "DealerParser"

    iput-object v0, p0, Lcom/bitauto/autoeasy/selectcar/Object/DealerDetailParser;->TAG:Ljava/lang/String;

    .line 56
    iput-object p1, p0, Lcom/bitauto/autoeasy/selectcar/Object/DealerDetailParser;->url:Ljava/lang/String;

    .line 57
    return-void
.end method


# virtual methods
.method public Paser2Object()V
    .locals 7

    .prologue
    const-string v6, "error :"

    .line 62
    :try_start_0
    iget-object v3, p0, Lcom/bitauto/autoeasy/selectcar/Object/DealerDetailParser;->url:Ljava/lang/String;

    invoke-static {v3}, Lcom/bitauto/autoeasy/tool/Caller;->doGet(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v2

    .line 63
    .local v2, str:Ljava/lang/String;
    if-eqz v2, :cond_0

    .line 64
    new-instance v1, Lorg/json/JSONArray;

    invoke-direct {v1, v2}, Lorg/json/JSONArray;-><init>(Ljava/lang/String;)V

    .line 65
    .local v1, jObj:Lorg/json/JSONArray;
    const/4 v3, 0x0

    invoke-virtual {v1, v3}, Lorg/json/JSONArray;->getJSONObject(I)Lorg/json/JSONObject;

    move-result-object v3

    invoke-virtual {p0, v3}, Lcom/bitauto/autoeasy/selectcar/Object/DealerDetailParser;->createDealer(Lorg/json/JSONObject;)Lcom/bitauto/autoeasy/selectcar/Object/Dealer;

    move-result-object v3

    iput-object v3, p0, Lcom/bitauto/autoeasy/selectcar/Object/DealerDetailParser;->dealer:Lcom/bitauto/autoeasy/selectcar/Object/Dealer;
    :try_end_0
    .catch Lorg/json/JSONException; {:try_start_0 .. :try_end_0} :catch_0
    .catch Lcom/bitauto/autoeasy/tool/WSError; {:try_start_0 .. :try_end_0} :catch_1

    .line 73
    .end local v1           #jObj:Lorg/json/JSONArray;
    .end local v2           #str:Ljava/lang/String;
    :cond_0
    :goto_0
    return-void

    .line 67
    :catch_0
    move-exception v3

    move-object v0, v3

    .line 68
    .local v0, e:Lorg/json/JSONException;
    iget-object v3, p0, Lcom/bitauto/autoeasy/selectcar/Object/DealerDetailParser;->TAG:Ljava/lang/String;

    new-instance v4, Ljava/lang/StringBuilder;

    const-string v5, "error :"

    invoke-direct {v4, v6}, Ljava/lang/StringBuilder;-><init>(Ljava/lang/String;)V

    invoke-virtual {v0}, Lorg/json/JSONException;->toString()Ljava/lang/String;

    move-result-object v5

    invoke-virtual {v4, v5}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v4

    invoke-virtual {v4}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v4

    invoke-static {v3, v4}, Landroid/util/Log;->e(Ljava/lang/String;Ljava/lang/String;)I

    .line 69
    const/4 v3, 0x0

    iput-object v3, p0, Lcom/bitauto/autoeasy/selectcar/Object/DealerDetailParser;->dealer:Lcom/bitauto/autoeasy/selectcar/Object/Dealer;

    goto :goto_0

    .line 70
    .end local v0           #e:Lorg/json/JSONException;
    :catch_1
    move-exception v3

    move-object v0, v3

    .line 71
    .local v0, e:Lcom/bitauto/autoeasy/tool/WSError;
    iget-object v3, p0, Lcom/bitauto/autoeasy/selectcar/Object/DealerDetailParser;->TAG:Ljava/lang/String;

    new-instance v4, Ljava/lang/StringBuilder;

    const-string v5, "error :"

    invoke-direct {v4, v6}, Ljava/lang/StringBuilder;-><init>(Ljava/lang/String;)V

    invoke-virtual {v0}, Lcom/bitauto/autoeasy/tool/WSError;->toString()Ljava/lang/String;

    move-result-object v5

    invoke-virtual {v4, v5}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v4

    invoke-virtual {v4}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v4

    invoke-static {v3, v4}, Landroid/util/Log;->e(Ljava/lang/String;Ljava/lang/String;)I

    goto :goto_0
.end method

.method public createDealer(Lorg/json/JSONObject;)Lcom/bitauto/autoeasy/selectcar/Object/Dealer;
    .locals 5
    .parameter "obj"

    .prologue
    .line 82
    new-instance v0, Lcom/bitauto/autoeasy/selectcar/Object/Dealer;

    invoke-direct {v0}, Lcom/bitauto/autoeasy/selectcar/Object/Dealer;-><init>()V

    .line 84
    .local v0, dealer:Lcom/bitauto/autoeasy/selectcar/Object/Dealer;
    :try_start_0
    const-string v2, "vci_SaleTel"

    invoke-virtual {p1, v2}, Lorg/json/JSONObject;->getString(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v2

    invoke-virtual {v0, v2}, Lcom/bitauto/autoeasy/selectcar/Object/Dealer;->setCallCenterNumber(Ljava/lang/String;)V

    .line 85
    const-string v2, "bizmode"

    invoke-virtual {p1, v2}, Lorg/json/JSONObject;->getString(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v2

    invoke-virtual {v0, v2}, Lcom/bitauto/autoeasy/selectcar/Object/Dealer;->setVendorBizMode(Ljava/lang/String;)V

    .line 86
    const-string v2, "vbi_fullname"

    invoke-virtual {p1, v2}, Lorg/json/JSONObject;->getString(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v2

    invoke-virtual {v0, v2}, Lcom/bitauto/autoeasy/selectcar/Object/Dealer;->setVendorFullName(Ljava/lang/String;)V

    .line 87
    const-string v2, "vendorID"

    invoke-virtual {p1, v2}, Lorg/json/JSONObject;->getString(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v2

    invoke-virtual {v0, v2}, Lcom/bitauto/autoeasy/selectcar/Object/Dealer;->setVendorID(Ljava/lang/String;)V

    .line 88
    const-string v2, "vbi_name"

    invoke-virtual {p1, v2}, Lorg/json/JSONObject;->getString(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v2

    invoke-virtual {v0, v2}, Lcom/bitauto/autoeasy/selectcar/Object/Dealer;->setVendorName(Ljava/lang/String;)V

    .line 89
    const-string v2, "vci_SaleAddr"

    invoke-virtual {p1, v2}, Lorg/json/JSONObject;->getString(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v2

    invoke-virtual {v0, v2}, Lcom/bitauto/autoeasy/selectcar/Object/Dealer;->setVendorSaleAddr(Ljava/lang/String;)V

    .line 90
    const-string v2, "AutoSiteDomain"

    invoke-virtual {p1, v2}, Lorg/json/JSONObject;->getString(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v2

    invoke-virtual {v0, v2}, Lcom/bitauto/autoeasy/selectcar/Object/Dealer;->setVendorsite(Ljava/lang/String;)V

    .line 91
    const-string v2, "VendorShopPic"

    invoke-virtual {p1, v2}, Lorg/json/JSONObject;->getString(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v2

    invoke-virtual {v0, v2}, Lcom/bitauto/autoeasy/selectcar/Object/Dealer;->setImage(Ljava/lang/String;)V

    .line 92
    const-string v2, "GoogleMapLng"

    invoke-virtual {p1, v2}, Lorg/json/JSONObject;->getString(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v2

    invoke-virtual {v0, v2}, Lcom/bitauto/autoeasy/selectcar/Object/Dealer;->setGoogleMapLng(Ljava/lang/String;)V

    .line 93
    const-string v2, "GoogleMapLat"

    invoke-virtual {p1, v2}, Lorg/json/JSONObject;->getString(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v2

    invoke-virtual {v0, v2}, Lcom/bitauto/autoeasy/selectcar/Object/Dealer;->setGoogleMapLat(Ljava/lang/String;)V
    :try_end_0
    .catch Lorg/json/JSONException; {:try_start_0 .. :try_end_0} :catch_0

    move-object v2, v0

    .line 99
    :goto_0
    return-object v2

    .line 96
    :catch_0
    move-exception v2

    move-object v1, v2

    .line 97
    .local v1, e:Lorg/json/JSONException;
    const-string v2, "BrandParser"

    new-instance v3, Ljava/lang/StringBuilder;

    const-string v4, "error :"

    invoke-direct {v3, v4}, Ljava/lang/StringBuilder;-><init>(Ljava/lang/String;)V

    invoke-virtual {v1}, Lorg/json/JSONException;->toString()Ljava/lang/String;

    move-result-object v4

    invoke-virtual {v3, v4}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v3

    invoke-virtual {v3}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v3

    invoke-static {v2, v3}, Landroid/util/Log;->i(Ljava/lang/String;Ljava/lang/String;)I

    .line 98
    invoke-virtual {v1}, Lorg/json/JSONException;->printStackTrace()V

    .line 99
    const/4 v2, 0x0

    goto :goto_0
.end method

.method public getDealer()Lcom/bitauto/autoeasy/selectcar/Object/Dealer;
    .locals 1

    .prologue
    .line 43
    iget-object v0, p0, Lcom/bitauto/autoeasy/selectcar/Object/DealerDetailParser;->dealer:Lcom/bitauto/autoeasy/selectcar/Object/Dealer;

    return-object v0
.end method

.method public setDealer(Lcom/bitauto/autoeasy/selectcar/Object/Dealer;)V
    .locals 0
    .parameter "dealer"

    .prologue
    .line 47
    iput-object p1, p0, Lcom/bitauto/autoeasy/selectcar/Object/DealerDetailParser;->dealer:Lcom/bitauto/autoeasy/selectcar/Object/Dealer;

    .line 48
    return-void
.end method
